#pragma once

#include "pch.h"
#include "prerequisites.h"
#include "scene_node.h"

class c_mesh_entity : public c_scene_node 
{
    typedef c_scene_node super;
public:
    explicit c_mesh_entity(c_scene *scene_mgr, const std::string& name, mesh_ptr mesh_ptr); 
    ~c_mesh_entity(); 

    virtual bool update(c_scene *scene, const float dt); 

    virtual void pre_render(c_scene*); 
    virtual void render(c_scene*); 
    virtual void post_render(c_scene*); 
    
    void upload_gpu_parameters(material_ptr& material);
    virtual void upload_gpu_parameters_impl(material_ptr& matrial);
    
    mesh_ptr& get_mesh() { return m_mesh_ptr; }

private:
    mesh_ptr m_mesh_ptr;
};

mesh_entity_ptr make_entity(const std::string& name, const mesh_ptr& mesh);
mesh_entity_ptr make_simple_cube(const material_ptr& material); 